<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="div1" class="divClass" data-oid="23">test1</div><button id="btn_a">测试</button>
    <br>
    <a href="../index.html" id="a1">我是一个a标签</a>
    <input type="checkbox" id="cbx_test">
    <button id="btn_test">测试</button>
</body>

</html>
<script>
    document.getElementById("btn_test").addEventListener('click', () => {
        document.getElementById("cbx_test").toggleAttribute("checked");
    }, false);

    document.getElementById("btn_a").addEventListener('click', () => {
        let node = document.getElementById("div1");
        node.innerHTML = "<a href='../index.html'>a标签</a>";
    }, false);

</script>